package com.vinoxm.infoc.controller;

import com.vinoxm.infoc.annotion.NeedSecret;
import com.vinoxm.common.base.result.BaseResult;
import com.vinoxm.infoc.model.SteamAccount;
import com.vinoxm.common.base.result.DataResult;
import com.vinoxm.infoc.service.TOTPService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("TOTP")
public class TOTPController extends BaseController<TOTPService> {

    @PostMapping("steam")
    @NeedSecret("steam.token.mAou864")
    public BaseResult steamAccountTOTP(@RequestBody SteamAccount account) {
        return DataResult.Success(baseService.steamAccountToken(account.getAccountName()), "Success!");
    }
}
